<?php
require_once 'pworks/mvc/IResult.iface.php';
require_once 'pworks/mvc/result/PageLoader.class.php';

class CmsResult implements IResult
{
    public function show(IAction &$action, ResultConfig $config)
    {
        $pageId = $config->src;
        $page = PageLoader::load($pageId);
        $page->data = $action->getData();
		$page->messages = array_merge((array) $action->getErrors(), (array) $action->getWarnings(), (array) $action->getInfos());
        echo $page->render();
    }
}
